package com.punch;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableAsync
@EnableFeignClients
@EnableScheduling
public class OrderApp9003 {

    public static void main(String[] args) {
        SpringApplication.run(OrderApp9003.class, args);
    }

    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("punchredis").setConnectionPoolSize(1).setSubscriptionConnectionPoolSize(1).setConnectionMinimumIdleSize(1);
//        config.useSingleServer().setAddress("redis://127.0.0.1:6379").setConnectionPoolSize(1).setSubscriptionConnectionPoolSize(1).setConnectionMinimumIdleSize(1);
        return Redisson.create(config);
    }
}
